package com.kloooong.top.controller;


import com.kloooong.top.message.UserVipMember;
import com.kloooong.top.producer.UserMemberProducer;
import com.kloooong.top.producer.UserVipProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.UUID;

@RestController
@RequestMapping("/msg")
public class IndexCtrl {

    @Autowired
    private UserVipProducer userVipProducer;

//    @Autowired
//    private UserMemberProducer userMemberProducer;

    @RequestMapping("/send")
    public boolean send(String headerId){
        UserVipMember member = new UserVipMember();
        member.setId(UUID.randomUUID().toString());
        member.setName("kelong");
        member.setCreateDate(new Date());
        return userVipProducer.sendVip(member,headerId);
    }


    @RequestMapping("/user")
    public boolean user(){
        //return userMemberProducer.sendVip02();
        return false;
    }

}
